@extends('Layout.main')
@section('content')
    @include('layout.error')
    <div class="col-sm-8 blog-main">
        <form action="/article/" method="POST" enctype="multipart/form-data">
            {{csrf_field()}}
            <div class="form-group">
                <label>标题</label>
                <input name="title" type="text" class="form-control" placeholder="这里是标题" value="{{old('title')}}">
            </div>
            <div class="form-group">
                <label>标题图</label>
                <input type="file" name="pic" class="form-control">
            </div>
            <div class="form-group">
                <label>简介</label>
                <textarea name="intro" class="form-control" placeholder="这里是简介"></textarea>
            </div>
            <div class="form-group">
                <label>内容</label>
                <textarea id="content" name="content" >{{Session::getOldInput('content')}}</textarea>
            </div>
            <button type="submit" class="btn btn-default">提交</button>
        </form>
        <br>
    </div><!-- /.blog-main -->
@endsection

@section('my_js')
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"> </script>
    <script>
        var ue = UE.getEditor('content');
        //对编辑器的操作最好在编辑器ready之后再做
        // ue.ready(function() {
        //     //设置编辑器的内容
        //     ue.setContent('hello');
        // });
    </script>
@endsection
